package me.chendan.sql

import java.io.PrintWriter

import scala.util.Random

/**
  * Created by chendan on 16-4-6.
  */
object DataGenerator extends App{
  val nums: Int = args.length match {
    case x: Int if x > 0 => args(0).toInt
    case _ => 100
  }
  val writer = new PrintWriter("student.txt")
  val rand = new Random()
  for (i <- 1 to nums) {
    writer.println(i + "," + (rand.nextInt(100) + 1) + "," + (rand.nextInt(100) + 1) + "," + (rand.nextInt(100) + 1))
  }
  writer.close()
  println("finished")
}
